package com.stm.bi.service;

import com.stm.framework.model.CustomizePage;
import com.stm.framework.dto.Response;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import java.util.List;
import com.stm.bi.dto.vo.SubjectCategoryVO;
import com.stm.bi.dto.vo.SubjectCategoryTreeVO;
import com.stm.bi.dto.query.SubjectCategoryListQry;
import com.stm.bi.dto.query.SubjectCategoryPageQry;
import com.stm.bi.dto.query.SubjectCategoryTreeQry;
import com.stm.bi.dto.cmd.SubjectCategoryAdd;
import com.stm.bi.dto.cmd.SubjectCategoryUpd;
import com.stm.bi.executor.SubjectCategoryQueryExe;
import com.stm.bi.executor.SubjectCategorySaveExe;

/**
* 科目分类-服务
*
* @author qinyongjie
 * @date 2025-05-22
 */
@Service
public class SubjectCategoryService {
    @Resource
    private SubjectCategoryQueryExe subjectCategoryQueryExe;
    @Resource
    private SubjectCategorySaveExe subjectCategorySaveExe;

    //region 主体方法区
    /**
    * 查询单条
    * @param id
    */
    public Response<SubjectCategoryVO> selectById(Long id) {
        return subjectCategoryQueryExe.selectById(id);
    }

    /**
    * 保存
    * @param subjectCategoryAdd
    */
    public Response create(SubjectCategoryAdd subjectCategoryAdd) {
        return subjectCategorySaveExe.create(subjectCategoryAdd);
    }

    /**
    * 更新
    * @param subjectCategoryUpd
    */
    public Response update(SubjectCategoryUpd subjectCategoryUpd) {
         return subjectCategorySaveExe.update(subjectCategoryUpd);
    }

    /**
     * 查询分类树
     */
    public Response<List<SubjectCategoryTreeVO>> selectTree(SubjectCategoryTreeQry qry) {
        return subjectCategoryQueryExe.selectTree(qry);
    }
    //endregion

}
